package com.tanhua.server.controller;

import com.tanhua.model.vo.SoundVO;
import com.tanhua.server.service.PeachBlossomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/peachblossom")
public class PeachBlossomController {

    @Autowired
    private PeachBlossomService peachBlossomService;

    /**
     * 探花传音  获取音频
     * @return
     */
    @GetMapping
    public ResponseEntity getPeachBlossom(){

        SoundVO soundVO = peachBlossomService.getPeachBlossom();
        return ResponseEntity.ok(soundVO);
    }

    /**
     * 发送语音
     * @param soundFile
     * @return
     */
    @PostMapping
    public ResponseEntity sendSound(MultipartFile soundFile) {
        peachBlossomService.sendSound(soundFile);
        return ResponseEntity.ok(null);
    }



}
